package com.yzy.fly.entity.role;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.google.common.collect.Lists;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@TableName("fly_view")
public class FlyView implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;
//
//    private String name;
//    @TableField(value = "widgetList",typeHandler = FastjsonTypeHandler.class)
    @TableField(exist = false)
    private List<FlyViewWidget> widgetList;

    private Integer systemId;

    private Date createTime;

    private Date updateTime;
    @TableField(exist = false)
    private FormConfig formConfig;

    public void addWidget(FlyViewWidget widget){
        if (widgetList == null) {
            widgetList = Lists.newArrayList();
        }
        widgetList.add(widget);
    }

}
